package com.sohoappspot.sohosched.client.events;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TreeItem;
import com.sohoappspot.sohosched.client.SohoConstants;

public class NavigationEvent extends GwtEvent<NavigationHandler> {


	public enum NavigationEventType {
		NotSet,
	    Changed, 
	    Init
	}
	
	private SohoConstants.ViewMode navigationViewMode;
	private TreeItem navigationTreeItem;
	private NavigationEventType navigationEventType = NavigationEventType.NotSet;  
	
	public NavigationEvent(NavigationEventType navigationEventType, SohoConstants.ViewMode navigationViewMode, TreeItem navigationTreeItem){
		super();
		this.navigationTreeItem = navigationTreeItem; 
		this.navigationEventType = navigationEventType;
		this.navigationViewMode = navigationViewMode;  
	}
	
	public static final Type<NavigationHandler> TYPE = new Type<NavigationHandler>();
	
	@Override
	protected void dispatch(NavigationHandler handler) {
		handler.onNavigation(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<NavigationHandler> getAssociatedType() {
		return TYPE;
	}
	
	public SohoConstants.ViewMode getNavigationViewMode(){
		return navigationViewMode; 
	}
	
	public void setNavigationViewMode(SohoConstants.ViewMode value){
		this.navigationViewMode = value; 
	}

	public TreeItem getNavigationTreeItem(){
		return navigationTreeItem; 
	}
	
	public void setNavigationTreeItem(TreeItem value){
		this.navigationTreeItem = value; 
	}
	
	public NavigationEventType getNavigationEventType(){
		return navigationEventType; 
	}
	
	public void setNavigationEventType(NavigationEventType value){
		this.navigationEventType = value; 
	}
	
	public Composite getContent(){
		return null;
	}

}
